<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>nginx ip测试</title>
</head>
<body>
<body>
	<%
		String scheme = request.getScheme(); //协议
		int port = request.getServerPort(), portR = request.getRemotePort();
		String requestURIC1 = scheme + "://" + request.getHeader("X-Forwarded-For") + ":" + portR;
		String requestURIC2 = scheme + "://" + request.getHeader("X-Real-IP") + ":" + portR;
		String requestURIC3 = scheme + "://" + request.getRemoteAddr() + ":" + portR;
		String requestURI = scheme + "://" + request.getServerName() + ":" + port;
	%>
	<center>
		<pre>
			<h1>     
客户端地址1 : <%=requestURIC1%>
客户端地址2 : <%=requestURIC2%>
客户端地址3 : <%=requestURIC3%>
服务器地址1 : <%=requestURI%>
服务器地址2 : <%=request.getHeader("Host")%></h1>
		</pre>
	</center>
</body>
</html>
